#!/bin/bash

# Exercise 3
# Author: Michael Joergler
# Date: 8.10.2013
# Version: 1.0

PROCCOUNT=$(ps -A | wc -l)
if [ $PROCCOUNT -gt $1 ] 
then
 echo There are more than $1 processes running \($PROCCOUNT\)
fi

PORTCOUNT=$(lsof -i | wc -l)
if [ $PORTCOUNT -gt $2 ]
then
 echo There are more than $2 ports open \($PORTCOUNT\)
fi
